<%-- 
    Document   : chat
    Created on : Apr 5, 2011, 9:08:37 AM
    Author     : user
--%>
<%
    String baseURL = "";
    int userId = 0;
    HttpSession sess = request.getSession(false);
    System.out.println(sess);
    String role = (String) sess.getAttribute("role");
    if(role == null || role.equalsIgnoreCase("admin") == true){
        if(role == null)
            response.sendRedirect("index.jsp");
        else if (role.equalsIgnoreCase("admin")== true)
            response.sendRedirect("admin.jsp");
    } else {
        baseURL = getServletContext().getContextPath();
        userId = (Integer) request.getSession().getAttribute("id");
    }
%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>On Air -- Talk anything, it is free</title>
        <link rel="stylesheet" href="public/css/chat.css" type="text/css" media=screen />
        <script src="public/js/common.js" type="text/javascript"></script>
        <script src="public/js/ajax.js" type="text/javascript"></script>
        <script src="public/js/chat.js" type="text/javascript"></script>
        <script type="text/javascript">
            baseURL = "<%=baseURL%>";
            userId = "<%=userId%>";
        </script>
    </head>
    <body onload="init();">
        <div id="wrap">
            <div id="header">
                <div id="logo">
                    <img src="public/img/header_login.png" alt="logo" />
                </div>
                <div id="menu-bar" class="border">
                    <a href="Logout">Logout</a>
                </div>
            </div>
            <div id="content" class="border">
                <div id="left-column">
                    <div id="room-panel">
                        <!--
                        <div class="category">
                            <div class="category-name">Sport</div>
                            <div class="category">
                                <div class="category-name">Football</div>
                                <div class="room">Ac Milan</div>
                                <div class="room">MU</div>
                                <div class="room">Westham</div>
                            </div>
                            <div class="room">General</div>
                        </div>
                        <div class="category">
                            <div class="category-name">Entertaiment</div>
                            <div class="room">Music</div>
                        </div>
                        -->
                    </div>
                    <div id="friends-panel">
                        <div class="tab-container">
                            <div class="tab active" onclick="changeTab(this, 'friends-panel'); FriendPanel.showAll();">All</div>
                            <div class="tab"        onclick="changeTab(this, 'friends-panel'); FriendPanel.showOnline();">Online</div>
                            <div class="clear"></div>
                        </div>
                        <div class="friends">
                            <!--
                            <div class="friend">
                                <img src="" alt="off" class="status" />
                                <div class="friend-name">Ifan</div>
                            </div>
                            -->
                        </div>
                    </div>
                    <div class="clear"></div>
                </div>
                <div id="right-column">
                    <div class="tab-container">
                        <!--
                        <div class="tab active">
                        <div class="tab-text">
                        #ac-milan
                        </div>
                        <div class=tab-close>
                        x
                        </div>
                        </div>
                        <div class="tab">#progin</div>
                        -->
                    </div>
                    <div class="clear"></div>
                    <div id="main-chat-container">
                        <!--
                        <div class="chat-container">
                            <div class="chat-text">
                                Rezan Achmad : Halo, Boleh kenalan ga?
                            </div>
                        </div>
                        -->
                    </div>
                    <div id="user-room-container"></div>
                    <div class="clear"></div>
                    <input onkeypress="ChatBox.onEnter(event, this, this.value)" id="chat-box-input" />
                </div>
                <div class="clear"></div>
            </div>
            <div id="footer">
                <div class="outer">
                    <div class="inner">onAIR ~ on Adi_Ifan_Rezan ~ Where talks is free.. :D
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>
